Accessibility

Inserting the JavaScript Function

Use the following steps to insert the JavaScript function.

  1. If you have not already downloaded the source code for this tutorial, go to the beginning of this article and download it now to obtain the .js file that contains the function flevShowFramedFWPopup.
  2. Extract the files from the ZIP or SIT archive that you downloaded at the beginning of this article and define the folder containing the files as a site root in Dreamweaver MX. You will find the following contents in a folder named menu_scroller, which contains the following subfolders:

    • The completed_folder, which contains a finished site, including all HTML files, images and source PNG files. You can define this as a site in Dreamweaver to examine how the final scrolling menu system should work.
    • The javascript folder, which contains the JavaScript file where you can find the function flevShowFramedFWPopup. If you wish to, you can open this file, copy the contents, and paste them into the <script> section of your HTML.
    • The snippets folder, which contains files you can copy to the appropriate subfolder on your system to enable them to appear in your Snippets panel's pop-up menu in Dreamweaver:

      • Windows 2000, NT and XP:

        C:\Documents and Settings\<username>\Application Data\Macromedia\Dreamweaver MX\Configuration\Snippets\JavaScript\readable_MM_functions

      • Windows 98 and ME:

        C:\Windows\Application Data\Macromedia\Dreamweaver MX\Configuration\Snippets\JavaScript\readable_MM_functions

      • Macintosh OS X:

        Macintosh HD:Users:<username>:Library:Application Support:Macromedia:Dreamweaver MX:Configuration:Snippets:JavaScript:readable_MM_functions

      • Macintosh OS 9.X:

        Macintosh HD:System Folder:Application Support:Macromedia:Dreamweaver MX:Configuration:Snippets:JavaScript:readable_MM_functions

      I've included these folders as a convenience and they will be handy as you develop pages using Pop-up Menus in the future.

    • The start_folder, which contains the exported HTML, images, and source files which have not been altered. Define this folder as a site in Dreamweaver and use these files to build your first scrolling Pop-up Menu system in Dreamweaver. This folder contains the files you will work on as you go through this tutorial.
  3. Open the JS file in the script folder in Dreamweaver. The file will open in Code view.
  4. Choose Edit > Select All and then Edit > Copy to copy the entire function
  5. Switch to the HTML file that contains the Pop-up Menu triggers and switch to Code view if you are not already in Code view.
  6. Find the section in the <head> that contains the JavaScript functions. It should begin with:

    <SCRIPT language=JavaScript>

    ...and end with

    </SCRIPT>

  7. Each function between the open and close script tags begins with the word "function" and ends with a curly bracket. Insert the cursor after the last curly bracket before the </script> tag and press Enter/Return (Windows/Macintosh) to create an empty line to insert the function:

    flevShowFramedFWPopup

    For your convenience, I've created a snippet that contains the function, which you can place in your Dreamweaver MX\Configuration\Snippets\JavaScript\readable_MM_functions directory and then access from the Snippets panel in Dreamweaver MX. If you are using Dreamweaver or UltraDev 4, the included JS file has the code.

    Note: If you don't see any such tags, you can add them in Code view by typing the first tag on the line above the </head> tag and Dreamweaver MX will automatically create the closing tag. Place the cursor between the two tags and press Enter/Return (Windows/Macintosh) two times to create a blank line to paste the JavaScript into.

  8. Paste the function you copied in step 4 or insert the snippet into the JavaScript section of the code.
  9. Save your updated HTML file.